public class OOTest03 {
    public static void main(String[] args){
        //创建一个丈夫对象
        Husband huangxiaoming =new Husband();
        huangxiaoming.name="黄晓明";

        //创建一个妻子对象
        Wife baby=new Wife();
        baby.name="baby";

        //能通过丈夫找到妻子，能通过妻子找到丈夫
        huangxiaoming.w=baby;
        baby.h=huangxiaoming;

        //说明不了黄晓明和baby之间是存在关系的
        System.out.println(huangxiaoming.name+"的妻子名字叫："+baby.name);

        System.out.println(huangxiaoming.name+"的妻子名字叫："+huangxiaoming.w.name);
    }

}
